package week08.company02;

import java.util.Random;

/**
 * Created by zhangxiaokun on 2018/3/21.
        销售部门
 */
public class Sale extends Colleague {
    private int saleNum;

    public Sale(Mediator mediator) {
        super(mediator);
    }

    //卖电脑
    public void sellIBMComputer(int number) {
        System.out.println("销售了" + number + "台电脑");
        //通知中介者 销售电脑
        super.mediator.execute("sale.sell", number);
    }

    //反映销量情况
    public int getSaleStatus() {
        int saleNum = new Random().nextInt(100);    //随机生成一个销量
        return saleNum;
    }

    //打折销售
    public void offSale() {
        //通知中介者打折销售
        super.mediator.execute("sale.offSale");
    }


    public void setSaleNum(int saleNum) {
        this.saleNum = saleNum;
    }
}
